package com.aisino.config;

import com.aisino.interceptor.RequireAuthInterceptor;
import com.aisino.interceptor.RequireJwtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author guochuantao
 * @version 1.0
 * @description 配置类 注册拦截器
 * @since 2024/7/22 上午11:03
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        RequireAuthInterceptor requireAuthInterceptor = new RequireAuthInterceptor();
        registry.addInterceptor(requireAuthInterceptor);

        RequireJwtInterceptor requireJwtInterceptor = new RequireJwtInterceptor();
        registry.addInterceptor(requireJwtInterceptor);
    }
}
